package models;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Id;

import com.googlecode.objectify.annotation.Cached;
import com.googlecode.objectify.annotation.Indexed;
import com.googlecode.objectify.annotation.Unindexed;

@Cached
public class News {
	@Id private String id = ""; //Id = autoSiteId + "-" + url;
	
	@Indexed private String url = "";
	
	@Unindexed private String title = "";
	
	@Unindexed private String description = "";
	
	@Unindexed private String source = "";
	
	@Unindexed private List<String> labels = new ArrayList<String>();
	
	@Unindexed private boolean published = false;
	
	@Unindexed private boolean displaySource = true;
	
	@Indexed String autoSiteId = "";
	
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String createId() {
		return autoSiteId + "-" + url;
	}
	
	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getSource() {
		return source;
	}

	public void setSource(String source) {
		this.source = source;
	}
	
	public List<String> getLabels() {
		return labels;
	}

	public void setLabels(List<String> labels) {
		this.labels = labels;
	}
	
	public boolean getPublished() {
		return published;
	}

	public void setPublished(boolean published) {
		this.published = published;
	}

	public String getAutoSiteId() {
		return autoSiteId;
	}

	public boolean isDisplaySource() {
		return displaySource;
	}

	public void setDisplaySource(boolean displaySource) {
		this.displaySource = displaySource;
	}

	public void setAutoSiteId(String autoSiteId) {
		this.autoSiteId = autoSiteId;
	}
	
}